﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Frontend/Frontend.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<IntroduceCompany.QuestionView>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	ResultPAge
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<!--title menu-->
    <table border="0" cellpadding="0" cellspacing="0" width="100% ;">
        <tr>
            <td class="col-left">
                <!--Content left here-->
                
            </td>
            <td class="col-center">
                <div class="survey">
                    <%  IQueryable<IntroduceCompany.AnswerView> answerList;
                        int questionNo = 1;
                        string flag = "";
                        foreach (var item in Model){ %>
                        <div>
                            <div class="survey_fl">
                                <p class="items"><%= IntroduceCompany.Resources.Resx.Frontend_Survey_SurveyPage_lab_Question%> <%= questionNo++%>:</p>
                            </div>
                            <div class="survey_fr">
                                    <%= Html.Encode(item.QuestionContent)%><br />
                                    <table>
                                    <% answerList = IntroduceCompany.Singleton.DataSingleton.GetSurveyModels().GetAnswerList_Frontend(item.QuestionID, item.LanguageID);
                                       flag = "true";
                                       float percent = 0;
                                       foreach (var item2 in answerList)
                                       {
                                           percent = (float)(item2.ChoosenAmount) / (float)(item2.TotalChooser) * 100;
                                           if (flag == "true"){%>
                                             <tr><td colspan="4"><label><%= IntroduceCompany.Resources.Resx.Frontend_Survey_ResultPage_lab_TotalVote%> : <%= item2.TotalChooser%></label></td></tr>
                                            <%}
                                                flag = "false";
                                            %>
                                            <tr>
                                                 <td style="text-align: left; width: 190px">- <%= Html.Encode(item2.AnswerContent)%></td>
                                                 <td> <img src="/vi/PercentageBar/Show?percent=<%= Math.Round(percent).ToString("0")%>" alt="" /> </td>
                                                 <td style="text-align: right; width: 90px"> <%= Html.Encode(item2.ChoosenAmount)%> <%= IntroduceCompany.Resources.Resx.Frontend_Survey_ResultPage_lab_Vote%> </td>
                                                 <td style="text-align: right; width: 50px">  <%= item2.ChoosenAmount == 0 ? "0" : (percent.ToString("0,0.0"))%> %</td>
                                            </tr>
                                     <%} %>
                                     </table>
                            </div>
                        </div>
                    <% }%>
                </div>
            </td>
        </tr>
    </table>
</asp:Content>
